/*
 * $HeadURL: $
 * $Id: $
 * Copyright (c) 2013 by Wodensoft System, all rights reserved.
 */
package com.wodensoft.demo;

import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.MySQL5InnoDBDialect;
import org.hibernate.dialect.SQLServer2005Dialect;
import org.hibernate.engine.spi.RowSelection;
import org.junit.Test;

/**
 * @author Woden
 * 
 */
public class HibernateDialect {

    @Test
    public void testShowLimit() {
        Dialect dialect;
        RowSelection rowSelection = new RowSelection();
        rowSelection.setFirstRow(2);
        rowSelection.setMaxRows(100);

        dialect = new SQLServer2005Dialect();
        System.out.println(dialect.buildLimitHandler("select * from table where id = ? and name not like ?",
                rowSelection).getProcessedSql());
        System.out.println(dialect.getLimitString("select * from table", 0, 100));
    }
}
